package com.jlpay.openapi.demo.base;

import com.jlpay.open.jlpay.sdk.java.model.base.request.ListBankRequest;
import com.jlpay.open.jlpay.sdk.java.model.base.response.ListBankResponse;
import com.jlpay.open.jlpay.sdk.java.utils.json.JsonUtils;
import com.jlpay.openapi.demo.JlpayOpenApiService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * 银行总行信息查询
 *
 * @author zhangyongfeng
 * @date 2025/7/21
 */
public class ListBankService {

    private static final Logger LOGGER = LoggerFactory.getLogger(ListBankService.class);

    public static void main(String[] args) {
        ListBankRequest request = buildRequest();
        ListBankResponse response = JlpayOpenApiService.openMerchService()
                .post(request, ListBankResponse.class);

        LOGGER.info("银行总行信息查询响应:{}", JsonUtils.toString(response));
    }

    private static ListBankRequest buildRequest() {
        ListBankRequest request = new ListBankRequest();
        request.setBankName("工商银行");
        request.setBankCode("102");
        request.setLimit(10);
        request.setOffset(0);
        return request;
    }
}
